export const state = () => ({
  locales: ['en', 'cn'],
  locale: 'en',
  scrollTop: 0,
  isMobile: false,
})

export const mutations = {
  SET_LANG(state, locale) {
    if (state.locales.includes(locale)) {
      state.locale = locale
    }
  },
  SET_HEADER(state, scrollTop) {
    state.scrollTop = scrollTop
  },
  Mobile(state, data) {
    state.isMobile = data
  },
}
